package core;

/**
 * <p>Class that encapsulates all known information about a button that has been
 * pressed on a mobile device. This will <i>always</i> contain a non-null 
 * <code>keyName</code> value, but will not always have an associated <code>actionName</code>.
 * This button is used by the user to conveniently choose whether or not the button
 * pressed should be evaluated based upon it's programmed game action or its function
 * in terms of the device itself.</p>
 * 
 * @author Shayne Caswell
 *
 */
public class Button {
	/** String representation of a button's game action name. May be empty. */
	private String actionName;
	
	/** String representation of a button's key name. Never empty. */
	private String keyName;

	/**
	 * Instantiate a new Button, with some action and key name.
	 * 
	 * @param action String representation of this Button's game action.
	 * @param key String representation of this Button's function on the device.
	 */
	public Button(String action, String key){
		this.actionName = action;
		this.keyName = key;
	}
	
	/**
	 * Instantiate a new Button, with a key name. This button does not have
	 * an associated game action.
	 * 
	 * @param key String representation of this Button's function on the device.
	 */
	public Button(String key){
		this.actionName = null;
		this.keyName = key;
	}
	
	/**
	 * Getter method for <code>actionName</code>.
	 * 
	 * @return String representation of this Button's game action name.
	 */
	public String getActionName(){
		return this.actionName;
	}

	/**
	 * Getter method for <code>keyName</code>.
	 * 
	 * @return String representation of this Button's key name.
	 */
	public String getKeyName(){
		return this.keyName;
	}
}